package homework.Exercise4;

import homework.Exercise2And3.BoundedCounter;

public class CyclicCounter extends BoundedCounter {
    public CyclicCounter(int value, int highValue) {
        super(value, highValue);
    }

    public CyclicCounter(int value) {
        super(value);
    }

    @Override
    public void incrementer() {
        ++value;
        value%=highValue+1;
    }

    @Override
    public void decrementer() {
        super.decrementer();
        if(getValue()<0)value=highValue;
    }
}
